package com.hceax.servlet;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


//import java.sql.*;

/**
 * 
 * @author zhangli
 *
 */
public class SysDataSource {
	
	private static SysDataSource dataSource;
	private Connection conn;
	
	
	private SysDataSource(){
		
	}
	public static SysDataSource getInstance(){
		if(dataSource == null){
			dataSource = new SysDataSource();
		}
		return dataSource;
	}
	public Connection getConnection() throws SQLException{
		if(conn == null || conn.isClosed())
		{
				conn = DriverManager.getConnection("jdbc:mysql://localhost/mytest","root","909");
		}
		return conn;
	}

}
